package com.gee.spring.boot.rpf.client.exicr2;

import com.gee.spring.boot.rpf.client.AbstractClient;
import com.gee.spring.boot.rpf.util.CommonUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * desc:
 *
 * @author gee wrote on  2020-10-15 15:57:13
 */
@Component
@Scope(value = "prototype")
public class ExiCr2Client extends AbstractClient<ExiCr2Request, ExiCr2Response> {

    private final Logger logger = LoggerFactory.getLogger(ExiCr2Client.class);

    @Override
    public String getCacheKey(ExiCr2Request req) {
        return CommonUtil.buildRequestCacheKey(req.getCertId());
    }

    @Override
    public ExiCr2Response call(ExiCr2Request req) throws Exception {
        Thread.sleep(1500);
        ExiCr2Response response = new ExiCr2Response();
        response.setCode("000000");
        response.setMsg("调用成功");
        response.setFundBasePayment(1800d);
        return response;
    }
}
